package com.woniuxy.driver.service.impl;

import com.woniuxy.commons.entity.Driver;
import com.woniuxy.commons.entity.vo.ResultS;
import com.woniuxy.commons.entity.vo.ResultVo;
import com.woniuxy.driver.mapper.DriverMapper;
import com.woniuxy.driver.service.DriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author rmw
 * @date 2020/12/5 15:12
 */
@Service
public class DriverServiceImpl implements DriverService {

    @Autowired
    private DriverMapper driverMapper;

    @Override
    public ResultVo<Object> register(Driver driver) {
        int flag = driverMapper.register(driver);
        if (flag != 0){
            //注册成功
            ResultVo<Object> resultVo = new ResultVo<>();
            resultVo.setResultS(ResultS.SUCCESS);
            return resultVo;
        }else {
            //注册失败
            ResultVo<Object> resultVo = new ResultVo<>();
            resultVo.setResultS(ResultS.FAILURE);
            return resultVo;
        }
    }
}
